package com.elementalgeeks.android;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;


public class Circle extends View {
    private float x;
    private float y;
    private final int r;
    private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    
    public Circle(Context context, float x, float y, int r) {
        super(context);
        
        this.x = x;
        this.y = y;
        this.r = r;
        mPaint.setColor(Color.RED);        
    }  
    
    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawCircle(x, y, r, mPaint);
    }
    
    public void move(float x, float y) {
    	this.x -= x;
    	this.y += y;
    	this.invalidate();
    }
    
    public void setPosition(float newX, float newY) {
    	this.x = newX;
    	this.y = newY;
    	this.invalidate();
    }    
}
